<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>滑动数字</title>
    <style>
        body{
            background: url("./img/background4.gif");
        }
        .center{
            margin:0 auto;
            text-align:center;
        }
        h1{
            font-size: 200px;
        }
        #mainContent{
            margin-top: 250px;
            font-size:50px;
        }
        input[type="range"] {
            -webkit-box-shadow: 0 1px 0 0px #424242, 0 1px 0 #060607 inset, 0px 2px 10px 0px black inset, 1px 0px 2px rgba(0, 0, 0, 0.4) inset, 0 0px 1px rgba(0, 0, 0, 0.6) inset;
            margin-top: 2px;
            background-color: rgba(7, 184, 236, 0.04);
            border-radius: 55px;
            width: 100%;
            -webkit-appearance: none;
            height:50px;
        }
        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            cursor: default;
            top: -5px;
            height: 70px;
            width: 60px;
            transform: translateY(-4px);
            background: none repeat scroll 0 0 #777;
            border-radius: 45px;
            -webkit-box-shadow: 0 -1px 1px black inset;
        }
        button{
            width:200px;
            height:80px;
            font-size:50px;
        }

    </style>
    <script>
        function rangeChange() {
            var rangeValue=document.getElementById("game").value;
            document.getElementById("rangeValue").innerHTML=rangeValue;
        }
        function action() {
            var result=document.getElementById("rangeValue").innerHTML;
            document.getElementById("result").innerHTML=result;
            document.getElementById("game").style.visibility="hidden";
            document.getElementById("title").innerHTML="确定的数字是：";
            document.getElementById("rangeValue").style.visibility="hidden";
        }
        function refresh() {
            document.getElementById("game").value=1;
            document.getElementById("rangeValue").innerHTML="1";
            document.getElementById("result").innerHTML="";
            document.getElementById("game").style.visibility="visible";
            document.getElementById("title").innerHTML="滑动确定你想要的数字:";
            document.getElementById("rangeValue").style.visibility="visible";
        }
    </script>
</head>
<body>
<div id="mainContent" class="center">
<span id="title">滑动确定你想要的数字:</span>
<input type="range" name="game" id="game" min="1" max="100" step="1" value="1" oninput="rangeChange()"><span id="rangeValue">1</span>
<br>
<h1 id="result"></h1>
<button  onclick="action()" id="action"  >确 定</button>
    <hr>
    <button onclick="refresh()">重置</button>
</div>
</body>
</html>